
source(here::here("code/load.R"))

here("data/meta_analyses_raw/DinLuRic2021/Distribution-of-Study-Level-Effect-Sizes-Across-Existing-Studies copy_ocr.csv") |>
  read_csv() |>
  mutate(meta_id = "DinLuRic2021",
         subfield = "PA",
         question = "Does bureaucratic representation improve public organizational performance?",
         study_year = str_extract(Study,  "(?<=\\().+?(?=\\))"),
         numbers = str_extract_all(ES_95ci, "[+-]?[0-9]+([.][0-9]+)?")) |>
  unnest_wider(numbers, names_sep = "") |>
  rename(estimate = "numbers1",
         lower = "numbers2",
         upper = "numbers3") |>
  mutate(std.error = (as.numeric(upper) - as.numeric(lower)) / 3.92,
         estimate = as.numeric(estimate),
         overall_effect = "yes") |>
  select(meta_id,
         subfield,
         question,
         study_id = Study,
         study_year,
         estimate,
         std.error,
         overall_effect) |>
  write_csv(here("data/meta_analyses_clean/DinLuRic2021.csv"))
